<?php
/**
 * 默认控制器
 * @author Administrator
 *
 */
namespace App\Frontend\Controllers;
use Phalcon\Mvc\Controller;
use App\Library\Common\Common;


class Controllers extends Controller
{
	public $cookies;
	public $session;
	public $segments;
	public $common;
	/**
	 * 初始化
	 */
	public function onConstruct() {
		$this->cookies = $this->getDI()->get('cookies');
		$this->session = $this->getDI()->get('session');
		// Uri片段数组
		$this->segments = explode('/', parse_url($this->request->getUri(), PHP_URL_PATH));
		// 分配变量
		$vars = [
			'segments' => $this->segments
		];
		// Common插件
		$this->common = new Common();
		$this->view->setVars($vars);
	}
}
?>